import { Breadcrumb } from 'antd';
import { Link } from 'react-router-dom';

interface BreadcrumbItem {
  title: string;
  path?: string;
}

interface PageBreadcrumbProps {
  breadcrumbs: BreadcrumbItem[];
}

const PageBreadcrumb = ({ breadcrumbs }: PageBreadcrumbProps) => {
  return (
    <Breadcrumb>
      {breadcrumbs.map((item, index) => (
        <Breadcrumb.Item key={index}>
          {item.path ? <Link to={item.path}>{item.title}</Link> : item.title}
        </Breadcrumb.Item>
      ))}
    </Breadcrumb>
  );
};

export default PageBreadcrumb;